<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/10/19
  Time: 16:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page import="chatper01.bean.Student,java.util.*" %>
<html>
<head>
    <title>Title</title>
</head>
<%
    List<Student> lis = new ArrayList<>();
    Student stu1=new Student("001","李白","男","01",723.0);
//    Student stu1=new Student();
//    stu1.setStuId("001");
//    stu1.setStuName("李白");
//    stu1.setSex("男");
//    stu1.setClassRoom("01");
//    stu1.setScore(723.0);
//
    Student stu2=new Student();
    stu2.setStuId("002");
    stu2.setStuName("孟浩然");
    stu2.setSex("男");
    stu2.setClassRoom("02");
    stu2.setScore(689.0);

    Student stu3=new Student();
    stu3.setStuId("003");
    stu3.setStuName("杨玉环");
    stu3.setSex("女");
    stu3.setClassRoom("03");
    stu3.setScore(600.0);

    lis.add(stu1);
    lis.add(stu2);
    lis.add(stu3);
%>
<body>
<table>
    <tr>
        <th>学号</th>
        <th>姓名</th>
        <th>性别</th>
        <th>班级</th>
        <th>成绩</th>
    </tr>
    <%
//        for (Student stu:lis) {
        for (int i =0;i<lis.size();i++) {
            Student stu = lis.get(i);
    %>
    <tr>
        <td><%=stu.getStuId()%></td>
        <td><%=stu.getStuName()%></td>
        <td><%=stu.getSex()%></td>
        <td><%=stu.getClassRoom()%></td>
        <td><%=stu.getScore()%></td>
    </tr>
    <%}%>

</table>
</body>
</html>
